package com.example.demo.model.enums;


import org.springframework.util.StringUtils;

public enum ModuleEnums {
    MODULE1("1","模块1"),
    MODULE2("2","模块2");
    private ModuleEnums(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    String code;
    String msg;

    public ModuleEnums getModule(String moduleName)
    {
        if(StringUtils.isEmpty(moduleName)){
            return null;
        }
        for(ModuleEnums e : ModuleEnums.values())
        {
            if (e.msg.equals(moduleName))
                return e;
        }
        return null;
    }
}
